<template>
  <div class="enterprise-info">
    <div class="com-top-nav">
      <van-nav-bar
        title="企业信息"
        left-arrow
        @click-left="onClickLeft"
      />
    </div>
    <div style="padding-bottom: 30px">
      <van-cell-group>
        <van-field
          v-model="info.license_name"
          disabled
          label="营业执照名称"
        />
        <van-field
          v-model="info.license_no"
          disabled
          label="营业执照编号"
        />
        <van-field
          v-model="info.phone"
          disabled
          label="企业联系电话"
        />
        <van-field
          v-model="info.address"
          disabled
          label="企业地址"
        />
        <van-field
          v-model="info.address_detail"
          disabled
          label="企业详细地址"
        />

        <div class="img-container">
          <p>企业营业执照</p>
          <img :src="info.image" style="height:200px;width:300px;" alt="">
        </div>

      </van-cell-group>
      <!-- <div class="button-two">
        <van-button @click="type = 1">兼职信息</van-button>
        <van-button type="default" @click="type = 2">企业评价</van-button>
      </div> -->
   <!--    <div id="message" v-show="type === 1">
        <task-list-item link="/home/taskDetail"></task-list-item>
        <task-list-item link="/home/taskDetail"></task-list-item>
      </div>
      <div id="evaluate" v-show="type === 2">
        <p>评价详情（755个人评价）</p>
        <div list>
          <div item>
            <img src="/static/img/person.jpg" alt="">
            <div text>
              <p>人的名称xxxxx</p>
              <em>2017-10-12</em>
            </div>
          </div>
            <van-rate
            v-model="value"
            :size="12"
            :count="5"
            color="#2ba"
            void-color="#ceefe8"
          />
        </div>
        <div list>
          <div item>
            <img src="/static/img/person.jpg" alt="">
            <div text>
              <p>人的名称xxxxx</p>
              <em>2017-10-12</em>
            </div>
          </div>
          <van-rate
            v-model="value"
            :size="12"
            :count="5"
            color="#2ba"
            void-color="#ceefe8"
          />
        </div>
        <div list>
          <div item>
            <img src="/static/img/person.jpg" alt="">
            <div text>
              <p>人的名称xxxxx</p>
              <em>2017-10-12</em>
            </div>
          </div>
          <van-rate
            v-model="value"
            :size="12"
            :count="5"
            color="#2ba"
            void-color="#ceefe8"
          />
        </div>
      </div> -->
    </div>
  </div>
</template>
<script>
  import validator from '../../common/validatorFunction';
  import zxImgPreview from '../../components/zx-img-preview';
  import taskListItem from '../../components/task-list-item';
  import { Rate } from 'vant';

  export default {
    name: 'enterpriseInfo',
    components: {
      zxImgPreview,
      taskListItem,
      vanRate: Rate
    },
    data(){
      return {
        isShowError: false,
        errorTips: '',
        info:[],
        type: 1,
        value: 3,
        formData: {
          name: 'xxx营业执照',
          id: '23109203412',
          phone: '0571-xxxxx',
          address: '北京市xxxxx',
          detailAddress: 'xx路xx号xx',
          imgList: [
            'https://img.yzcdn.cn/2.jpg',
            'https://img.yzcdn.cn/2.jpg'
          ]
        }
      }
    },
    created(){
      this.init()
    },
    methods: {
      onClickLeft() {
        this.$router.go(-1);
      },
      init(){
        this.axios.get('/api/company/info',{params:{uid:JSON.parse(sessionStorage.getItem('user')).uid}}).then(res=>{
          if(res.data.err_code == 0){
            this.info = res.data.data;
            console.log(res.data.data)
          }
        }).catch(e=>{
          this.$toast({message:e})
        })
      },
      handleSubmit() {
        // 保存数据
      }
    }
  }
</script>

<style scoped lang="less" type="text/less">
  @import url('../../../static/style/var');

  .button-two {
    display: flex;
    justify-content: space-around;
    padding-left: 10px;
    padding-right: 10px;
    margin-top: 30px;
    button {
      width: 30%;
    }
  }
  .img-container {
    padding: 10px 15px;
    color: #333;
    font-size: 14px;
    .img-list {
      padding: 10px 0;
    }
  }
  #evaluate {
    margin-top: 30px;
    padding: 10px 15px;
    color: #333;
    background-color: #ffffff;
    [list] {
      background: #fff;
      border-bottom: 1px solid #eee;
      padding: 10px;
      display: flex;
      justify-content: space-between;
      [item] {
        display: flex;
        flex: 1;
        align-items: center;
        img {
          border-radius: 50%;
          margin-right: 18px;
          width: 48px;
          height: 48px;
        }
        [text] {
          flex: 1;
          p {
            color: rgba(0, 0, 0, 1);
            font-size: 14px;
          }
        }
      }
      em {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-style: normal;
        color: rgba(128, 128, 128, 1);
        font-size: 12px;
      }
    }
  }
</style>
